function [ x] = history_perturb_noise(weight, idx, relevant_idx, target_hover_state, H, dt, model)
%UNTITLED4 Summary of this function goes here
%   Detailed explanation goes here
start_ned = 3*rand(3,1) - 1.5*ones(3,1);
rotation_axis = normc(randn(3,1));
rotation_angle = 0*2*pi*rand(); % radians
start_q = [sin(rotation_angle/2)*rotation_axis; cos(rotation_angle/2)];
basin = 15;

start_state = target_hover_state;
start_state(idx.ned) = start_ned;
start_state(idx.q) = start_q;

x(:,1) = start_state;

for t=1:H   
    delta_u = policy1(weight, x(:,t), target_hover_state, idx);
    noise_F_T = randn(6,1);
    x(:,t+1) = f_heli(x(:,t), delta_u, dt, model, idx, noise_F_T);
    if(norm(x(idx.ned,t+1) - target_hover_state(idx.ned,:)) > basin)
        break;
    end
end

end

